package com.spzx.cart.api;

import com.baomidou.mybatisplus.core.metadata.OrderItem;
import com.spzx.cart.api.domain.CartInfo;
import com.spzx.cart.api.factory.RemoteCartFallbackFactory;
import com.spzx.common.core.constant.SecurityConstants;
import com.spzx.common.core.constant.ServiceNameConstants;
import com.spzx.common.core.domain.R;
import com.spzx.common.core.web.domain.AjaxResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * ClassName: RemoteBrandService
 * Package: com.spzx.product.api
 * Description:
 */
@FeignClient(contextId = "remoteCartService",
        value = ServiceNameConstants.CART_SERVICE,
        fallbackFactory = RemoteCartFallbackFactory.class)
public interface RemoteCartService {

    @PostMapping("/updateCartPrice")
    R updateCartPrice(@RequestHeader(SecurityConstants.FROM_SOURCE) String source);

    @GetMapping("/getCheckList/{userId}")
    R<List<CartInfo>> getCheckList(@PathVariable("userId") Long userId,
                                   @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
    @DeleteMapping("/deleteCart/{skuId}")
    AjaxResult deleteCart(@PathVariable("skuId") List<Long> skuIds,@RequestHeader(SecurityConstants.FROM_SOURCE) String source);

}
